﻿using System.Collections.Generic;
using System.Linq;
using Fee.ViewModel;

namespace Fee.Orders.ViewModel
{
    public class ConstructionTaskViewData
    {
        public ConstructionTaskViewData()
        {
        }

        public ConstructionTaskViewData(ConstructionTask task)
        {
            Station = new StationViewModel(task.Station);
            Status = task.Status;
            Details = task.Details.Select(_ => new ConstructionDetailSimpleViewModel(_)).ToList();
            PlanCosts = task.PlanCosts.Select(_ => new ConstructionTaskPlanCostViewModel(_)).ToList();
        }

        public StationViewModel Station { get; set; }
        public IList<ConstructionTaskPlanCostViewModel> PlanCosts { get; set; }

        /// <summary>
        /// </summary>
        public IList<ConstructionDetailSimpleViewModel> Details { get; set; }

        /// <summary>
        /// </summary>
        public ConstructionTaskStatus Status { get; set; }
    }
}